package com.senlingspace.system.service;

import java.util.Date;
import java.util.List;

import com.github.pagehelper.PageInfo;
import com.senlingspace.common.core.domain.AjaxResult;
import com.senlingspace.common.core.domain.entity.SysUser;
import com.senlingspace.system.domain.dto.InvestorCollectDTO;
import com.senlingspace.system.domain.dto.InvestorShareDTO;
import com.senlingspace.system.domain.dto.OrderDto;
import com.senlingspace.system.domain.SlkjOrder;
import com.senlingspace.system.domain.query.senling.QueryOrderExport;
import com.senlingspace.system.domain.vo.InvestorCollectVo;
import com.senlingspace.system.domain.vo.InvestorShareVo;
import com.senlingspace.system.domain.vo.DetailsVo;
import com.senlingspace.system.domain.vo.PosOrderQueryVo;
import com.senlingspace.system.domain.vo.PosOrderVoV2;
import com.senlingspace.system.domain.vo.*;

/**
 * 订单Service接口
 *
 * @author SenlingSpace
 * @date 2024-07-01
 */
public interface ISlkjOrderService {

    /**
     * 投资方日分账汇总
     *
     * @param investorShareVo 订单
     * @return 订单集合
     */
    List<InvestorCollectDTO> getInvestorCollect(InvestorCollectVo investorShareVo);


    /**
     * 投资方日分账明细表
     *
     * @param investorShareVo 订单
     * @return 订单集合
     */
    List<InvestorShareDTO> getInvestorProfitShare(InvestorShareVo investorShareVo);

    /**
     * 查询订单
     *
     * @param orderId 订单主键
     * @return 订单
     */
    SlkjOrder selectSlkjOrderByOrderId(Long orderId);

    /**
     * 查询门店拥有退款权限的账号
     *
     * @param shopId 门店id
     * @return 订单集合
     */
    List<SysUser> listPre(Long shopId);

    /**
     * 查询订单列表和详情
     *
     * @param slkjOrder 订单
     * @return 订单集合
     */
    PageInfo<OrderDetailVo> listDetail(OrderDto slkjOrder);


    /**
     * 查询订单列表
     *
     * @param slkjOrder 订单
     * @return 订单集合
     */
    List<SlkjOrder> selectSlkjOrderList(SlkjOrder slkjOrder);
    List<SlkjOrder> selectSlkjOrderList(QueryOrderExport queryOrderExport);

    /**
     * 修改订单
     *
     * @param slkjOrder 订单
     * @return 结果
     */
    int updateSlkjOrder(SlkjOrder slkjOrder);

    /**
     * 批量删除订单
     *
     * @param orderIds 需要删除的订单主键集合
     * @return 结果
     */
    int deleteSlkjOrderByOrderIds(Long[] orderIds);

    /**
     * 查询pos订单v2
     *
     * @param queryParam
     * @param paginate
     * @return {@link PageInfo }<{@link PosOrderVoV2 }>
     */
    PageInfo<PosOrderVoV2> posOrdersV2(PosOrderQueryVo queryParam, boolean paginate);

    List<DetailsVo> details(Date startTime, Date endTime, Long shopId);

    InvestorPersionVO getInvestorTotalAmount(InvestorCollectVo investorCollectVo);


    Boolean getStatusByOrderNumber(String orderNumber);

    /**
     * 获取小票信息
     *
     * @param orderId
     * @return {@link ReceiptInfoVo }
     */
    ReceiptInfoVo getReceiptInfo(Long orderId);

    Integer ticketUseNum(String orderNumber, Long shopId);

    /**
     * 小程序端订单列表
     *
     * @param type
     * @param customerId
     * @param shopId
     * @param pageNum
     * @param pageSize
     * @return {@link List }<{@link MiniAppOrderVo }>
     */
    PageInfo<MiniAppOrderVo> miniAppOrderList(String type, Long customerId, Long shopId, Integer pageNum, Integer pageSize);

    /**
     * 订单详情
     *
     * @param orderId
     * @return {@link MiniAppOrderDetailVo }
     */
    MiniAppOrderDetailVo miniAppOrderDetail(Long orderId);

    /**
     * 核销码校验
     *
     * @param qrcode
     * @return {@link AjaxResult }
     */
    AjaxResult validateQrcode(String qrcode);

    /**
     * 修改订单地址
     *
     * @param req
     * @param customerId
     * @param shopId
     * @return {@link AjaxResult }
     */
    AjaxResult updateAddress(OrderAddressVo req, Long customerId, Long shopId);

    /**
     * 获取核销记录
     *
     * @param verificationRecordsRequest
     * @return {@link PageInfo }<{@link VerificationRecordsRequest }>
     */
    PageInfo<VerificationRecordsVo> verificationRecords(VerificationRecordsRequest verificationRecordsRequest);

    /**
     * 到付商品订单列表
     *
     * @param request
     * @param paginate
     * @return {@link PageInfo }<{@link PaymentUponReceiptDTO }>
     */
    PageInfo<PaymentUponReceiptDTO> paymentUponReceipt(PaymentUponReceiptRequest request, boolean paginate);

    /**
     * 到付订单详情
     *
     * @param orderId
     * @return {@link AjaxResult }
     */
    AjaxResult paymentUponReceiptDetail(Long orderId);

    /**
     * 更新订单发货状态
     *
     * @param request
     * @return {@link AjaxResult }
     */
    AjaxResult updateOrderDeliveryStatus(OrderDeliveryStatusRequest request);


    /**
     * 导出订单列表
     *
     * @author wangliang
     * @param queryOrderExport
     * @return java.util.List<com.senlingspace.system.domain.vo.OrderListExportVo>
     */
    List<OrderListExportVo> selectOrderListExportList(QueryOrderExport queryOrderExport);
}
